/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package ua.yandex.prodcons.threads;

import java.util.List;

/**
 *
 * @author Neophron
 */
public class Consumer implements Runnable {

    private final List<Integer> list;
    private final RingBuffer buffer;

    Consumer(List<Integer> list, RingBuffer buffer) {
        this.list = list;
        this.buffer = buffer;
    }

    @Override
    public void run() {
        list.add(buffer.take());
    }

}
